package com.guofen.dao;

import com.guofen.pojo.Food;
import com.guofen.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FoodMapper {
    List<Food> selectAll();

    Food selectByPrimaryKey(String name);

    int deleteByPrimaryKey(String name);

    int insertSelective(Food food);

    int updateByPrimaryKeySelective(Food food);

    List<Food> selectByCost(@Param("lowCost")Integer lowCost,
                            @Param("highCost")Integer highCost);

    List<Food> selectByType(String type);

    List<Food> selectByColor(String color);

    List<Food> selectByCostType(@Param("lowCost")Integer lowCost,
                                @Param("highCost")Integer highCost,
                                @Param("type")String type);

    List<Food> selectByTypeColor(@Param("type")String type,
                                 @Param("color")String color);

    List<Food> selectByCostColor(@Param("lowCost")Integer lowCost,
                                 @Param("highCost")Integer highCost,
                                 @Param("color")String color);

    int selectTypeCount(String type);

    int selectColorCount(String color);

    int selectCostCount(@Param("lowCost")Integer lowCost,
                        @Param("highCost")Integer highCost);

    int selectMaxCostInLimit(Integer cost);

    List<String> selectTypes();

    List<Food> selectByTypes(@Param("types") String[] types);
}
